#include"stdio.h"

int main()
{
	int n;
	scanf_s("%d", &n);
	for (int i=0;i<n;i++)
	{
		int a, b, c;
		scanf_s("%d %d %d", &a, &b, &c);
		if (a <= 0 || b <= 0 || c <= 0 || a + b <= c || a + c <= b || b + c <= a)
		{
			printf("Not Triangle\n");
			continue;
		}
		if (a == b && b == c)
		{
			printf("Regular Triangle\n");
		}
		else if ((a == b&&b!=c) || (b == c&&a!=c) || (a == c&&b!=c))
		{
			printf("Isosceles Triangle\n");
		}
		else
		{
			printf("Triangle\n");
		}
	}
	return 0;
}